import Vue from 'vue'
import Vuex from 'vuex'
import createPersistedState from 'vuex-persistedstate'
Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    token: ""
  },
  mutations: {
    add(state, token) {
      state.token = token
      console.log(state.token, token);
    },
    actions: {},
    modules: {},
    getters: {
      getUser(state) {
        return state.user
      },
      getShowLogin(state) {
        return state.showLogin
      }
    }
  },
  plugins: [createPersistedState()]
})